import { DataTypes } from "sequelize";
import sequelize from "../db/seq.js";
const Goods = sequelize.define("Goods", {
  name: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: "商品名称",
  },
  price: {
    type: DataTypes.DECIMAL(10, 2),
    allowNull: false,
    comment: "商品价格",
  },
  pic: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: "商品图片",
  },
  inventory: {
    type: DataTypes.INTEGER,
    allowNull: false,
    comment: "商品库存",
  },

  desc: {
    type: DataTypes.STRING,
    comment: "商品描述",
  },
});

// Goods.sync({ force: false });
export default Goods;
